<?php
	
	namespace Aspic\Config;
	
	use Aspic as A;
	
	abstract class AbstractFileConfig implements ConfigInterface {
		
		protected $data;
		
		public function __construct() {
			$this->data = null;
		}
		
		public function getData() {
			return $data;
		}

		public function load($filePath) {
			if (!is_file($filePath)) {
				throw new A\Exception('File "'.$filePath.'" does not exists');
			}
			
			$data = A\File\File::getContents($filePath);
			$data = $this->processFileContents($data);
			
			$this->data = $data;
		}
		
		/**
		 * Convert file content do a php array (config data)
		 */
		abstract protected function processFileContents($fileContents);
		
	}
